package com.dd.ent.car.ui.user.uservideo;

import android.content.Context;
import android.content.Intent;
import android.content.res.Configuration;
import android.os.Bundle;
import android.view.View;
import android.widget.TextView;

import com.dd.ent.car.R;
import com.dd.ent.car.common.player.MediaPlayerManager;
import com.dd.ent.car.ui.BaseActivity;
import com.pp.ent.view.annotation.ContentView;
import com.pp.ent.view.annotation.OnClick;
import com.pp.ent.view.annotation.ViewInject;


/**
 * Created by dengqu on 2017/4/6.
 */
@ContentView(R.layout.activity_user_video)
public class UserVideoActivity extends BaseActivity {
    @ViewInject(R.id.titlebar_title)
    private TextView titleBar;

    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        init();
    }

    @Override
    public void onConfigurationChanged(Configuration newConfig) {
        super.onConfigurationChanged(newConfig);
    }

    @Override
    protected void onDestroy() {
        super.onDestroy();
        MediaPlayerManager.getInstance().releaseMediaPlayer(MediaPlayerManager.PlayerTag.USER);
    }

    private void init() {
        titleBar.setText("我的视频");
    }

    public static void startSelf(Context context) {
        Intent intent = new Intent(context, UserVideoActivity.class);
        context.startActivity(intent);
    }

    @OnClick({R.id.titlebar_left})
    public void onnClick(View view) {
        switch (view.getId()) {
            case R.id.titlebar_left:
                finish();
                break;
        }
    }
}
